
import { createStore, applyMiddleware } from 'redux'
import thunkMiddleware from 'redux-thunk'
import rootReducer from '../reducers/index'
// import { createLogger } from 'redux-logger'
// import logger from 'redux-logger'
const reduxLogger = require('redux-logger')

const middlewares = [thunkMiddleware]

let logger = reduxLogger.createLogger({
  // ...options
}) 
middlewares.push(logger)

export default function configure(initialState) {
  const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore)

  const store = createStoreWithMiddleware(rootReducer, initialState)

  return store
}
